package com.gmail.dmitryustimov.ms.observer.java7_innerclasses;

import java.util.ArrayList;
import java.util.List;


public class Writer {

    List<Book> books = new ArrayList<Book>();
    List<Article> articles = new ArrayList<Article>();

    EventPublisher<Book> bookEventPublisher = new EventPublisher<Book>();
    EventPublisher<Article> articleEventPublisher = new EventPublisher<Article>();

    public void addBook(Book book) {
        books.add(book);
        bookEventPublisher.publish(book);
    }

    public void addArticle(Article article) {
        articles.add(article);
        articleEventPublisher.publish(article);
    }

}
